package com.secondHandPlatform.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    private boolean success;

    private int code;

    private String msg;

    private Object data;


    public  Result success(Object data){
        return new Result(true,200,"success",data);
    }

    public  Result error(int code, String msg){
        return new Result(false,code,msg,null);
    }
}
